:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #2ecc71;
    --warning: #f39c12;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, var(--primary), #1a2530);
    color: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

nav a:hover, nav a.active {
    background: rgba(255, 255, 255, 0.1);
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.banner {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
                url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?ixlib=rb-4.0.3');
    background-size: cover;
    background-position: center;
    color: white;
    border-radius: var(--radius);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.banner-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.banner-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.book-section {
    margin-bottom: 3rem;
}

.book-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.book-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.book-cover {
    height: 300px;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-info {
    padding: 1.5rem;
}

.book-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.category {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.download-btn {
    display: block;
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 0.7rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #2980b9;
}

.categories {
    margin-top: 3rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    padding: 2rem 1rem;
    border-radius: var(--radius);
    color: white;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card h3 {
    margin-top: 1rem;
}

.sci-fi {
    background: linear-gradient(135deg, #3498db, #2c3e50);
}

.literature {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.history {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.foreign {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.user-header {
    background: linear-gradient(135deg, var(--primary), #1a2530);
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.book-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.read-btn {
    flex: 1;
    background: var(--success);
    color: white;
    border: none;
    padding: 0.7rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.read-btn:hover {
    background: #27ae60;
}

.stats {
    margin: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

.profile-header {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background: #f1f2f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary);
}

.member-status {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 0.5rem;
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 2rem;
}

.profile-stats .stat {
    flex: 1;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.profile-stats .stat h3 {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.profile-stats .stat p {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.action-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    transition: transform 0.3s;
}

.action-card:hover {
    transform: translateY(-5px);
    color: var(--secondary);
}

.action-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.recent-activity {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.activity-list {
    list-style: none;
    margin-top: 1rem;
}

.activity-list li {
    display: flex;
    gap: 15px;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.activity-list li:last-child {
    border-bottom: none;
}

.activity-list i {
    font-size: 1.5rem;
    color: var(--secondary);
}

footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

footer p {
    margin: 0.3rem 0;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }

    .book-grid, .category-grid, .stats-grid, .action-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        flex-direction: column;
    }
}